package cn.jiaqiang.chatgpt.data.domain.order.repository;



import cn.jiaqiang.chatgpt.data.domain.order.model.aggregates.CreateOrderAggregate;
import cn.jiaqiang.chatgpt.data.domain.order.model.entity.PayOrderEntity;
import cn.jiaqiang.chatgpt.data.domain.order.model.entity.ProductEntity;
import cn.jiaqiang.chatgpt.data.domain.order.model.entity.ShopCartEntity;
import cn.jiaqiang.chatgpt.data.domain.order.model.entity.UnpaidOrderEntity;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @description 订单仓储接口
 */
public interface IOrderRepository {


    /** 查询未支付订单 */
    UnpaidOrderEntity queryUnpaidOrder(ShopCartEntity shopCartEntity);

    /** 查询商品 */
    ProductEntity queryProduct(Integer productId);

    /** 保存订单 */
    void saveOrder(CreateOrderAggregate aggregate);

    void updateOrderPayInfo(PayOrderEntity payOrderEntity);

    /**
     * 变更: 订单支付成功
     * @param orderId 订单id
     * @param transactionId 交易单号
     * @param totalAmount 总金额
     * @param payTime 支付时间
     */
    boolean changeOrderPaySuccess(String orderId, String transactionId, BigDecimal totalAmount, Date payTime);

    CreateOrderAggregate queryOrder(String orderId);

    /**
     * 订单商品发货
     *
     * @param orderId 订单ID
     */
    void deliverGoods(String orderId);

    /**
     * 查询待补货订单
     */
    List<String> queryReplenishmentOrder();

    List<String> queryNoPayNotifyOrder();

    /** 查询超时15分钟，未支付订单 */
    List<String> queryTimeoutCloseOrderList();

    boolean changeOrderClose(String orderId);

    List<ProductEntity> queryProductList();

}
